import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  { path: '/', component: () => import('@/views/Main.vue') },
  { path: '/contact', component: () => import('@/views/Contact.vue') },
  { path: '/search', component: () => import('@/views/Search.vue') },
  { path: '/other', component: () => import('@/views/Iframe.vue'), props: route => ({ src: route.query.src,share_id: route.query.share_id, id: route.query.id, title: route.query.title }) },
]

export default createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHistory(),
  routes, // `routes: routes` 的缩写
})
